$(function(){
    /*标准*/
    var radar = echarts.init(document.getElementById('radar'));
    option = {
        title: {
            text: ''
        },
        tooltip: {},
        legend: {

            data: ['第一季度', '第二季度','第三季度','第四季度'],
            x:"center",
            y:'bottom',
            textStyle:{
                color:"#fff"
            }
        },
        color: ['#4c95d9', '#f6731b', '#8cd43f','#9ccb63','#fcd85a','#60c1de','#0084c8'],
        radar: {
            name:{
                textStyle: {
                    //设置颜色
                    color:'#fff'
                }
            },
            indicator: [
                { name: '天津', max: 70,min:20},
                { name: '北京', max: 70,min:20},
                { name: '廊坊', max: 70,min:20},
                { name: '上海', max: 70,min:20},
                { name: '杭州', max: 70,min:20},
                { name: '重庆', max: 70,min:20},
                { name: '大连', max: 70,min:20},
                { name: '哈尔滨', max: 70,min:20},
            ],
            center: ['50%','50%'],
            radius: "58%"
        },
        series: [{
            name: '',
            type: 'radar',
            itemStyle : {
                normal : {
                    splitLine: {
                        lineStyle: {

                        }
                    },
                    label: {
                        show: false,
                        textStyle:{
                        },
                        formatter:function(params) {
                            return params.value;}
                    },
                }
            },
            data : [
                {
                    value : [66, 50, 40, 30, 20, 15, 20, 25],
                    name : '第一季度'
                },
                {
                    value : [62, 45, 45, 30, 18, 18, 21, 24],
                    name : '第二季度'
                },
                {
                    value : [65, 42, 38, 20, 20, 20, 20, 22],
                    name : '第三季度'
                },
                {
                    value : [70, 40, 40, 25, 20, 20, 20, 20],
                    name : '第四季度'
                }
            ]
        }]
    };
    radar.setOption(option);
  

    var graduateyear = echarts.init(document.getElementById('graduateyear'));
    option = {
        title : {
            text:"",
            x:'center',
            y:'top',
            textStyle:
            {
                color:'#fff',
                fontSize:13
            }
        },
        tooltip : {
            trigger: 'axis'
        },
        grid: {
            left: '3%',
            right: '8%',
            bottom: '5%',
            top:"13%",
            containLabel: true
        },
        color:['#4c95d9', '#f6731b', '#8cd43f','#9ccb63','#fcd85a','#60c1de','#0084c8'],
        legend: {
            data:['天津','北京','廊坊','上海','杭州','重庆','大连','哈尔滨'],
            show:true,
            right:'15%',
            y:"0",
            textStyle:{
                color:"#999",
                fontSize:'13'
            },
        },
        toolbox: {
            show : false,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        calculable : true,
        xAxis : [
            {
                type : 'category',
                boundaryGap : false,
                data : ['一季度','二季度','三季度','四季度'],
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#2d3b53'
                    }
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    alignWithLabel: true,
                    interval:0,
                }
            }
        ],
        yAxis : [
            {
                type : 'value',
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#2d3b53'
                    }
                },
                axisLabel:{
                    textStyle:{
                        color:"#999"
                    }
                },
            }
        ],
        series : [
            {
                name:'天津',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[2200,2100,2200,2300]
            },
            {
                name:'北京',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[1000,900,850,800]
            },
            {
                name:'廊坊',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[3000,3500,3500,3600]
            },
            {
                name:'上海',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[1000,1000,1000,900]
            },
            {
                name:'杭州',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[500,500,500,500]
            },
            {
                name:'重庆',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[2500,2500,2500,2600]
            },
            {
                name:'大连',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[2000,2000,2000,2000]
            },
            {
                name:'哈尔滨',
                type:'line',
                smooth:true,
                symbol:'roundRect',
                data:[1000,1000,1000,1000]
            },
        ]
    };
    graduateyear.setOption(option);

    /*  =====-=*/
    var courserate = echarts.init(document.getElementById('courserate'));
    option = {
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            right: '0',
            y:'middle',
            textStyle:{
                color:"#fff"
            },

            formatter:function(name){
                var oa = option.series[0].data;
                var num = oa[0].value + oa[1].value + oa[2].value + oa[3].value+oa[4].value+oa[5].value;
                for(var i = 0; i < option.series[0].data.length; i++){
                    if(name==oa[i].name){
                        return name +  ' '+oa[i].value;
                    }
                }
            },
            data: ['天津','北京','廊坊','上海','杭州','重庆','大连','哈尔滨']
        },
        series : [
            {
                name: 'FK',
                type: 'pie',
                radius : '45%',
                color:['#27c2c1','#9ccb63','#fcd85a','#60c1de','#0084c8','#d8514b','#519cff','#c39705'],
                center: ['38%', '50%'],
                data:[
                    {value:6000, name:'天津'},
                    {value:200, name:'北京'},
                    {value:2300, name:'廊坊'},
                    {value:700, name:'上海'},
                    {value:600, name:'杭州'},
                    {value:1800, name:'重庆'},
                    {value:1200, name:'大连'},
                    {value:800, name:'哈尔滨'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                },
                itemStyle: {
                    normal: {
                        label:{
                            show: true,
                            position:'outside',
                            formatter: '{b}'
                        }
                    },
                    labelLine :{show:true}
                }
            }
        ]
    };
    courserate.setOption(option);

    /* =======*/
    var professionrate = echarts.init(document.getElementById('professionrate'));
    option = {
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            right: '0',
            y:'middle',
            textStyle:{
                color:"#fff"
            },

            formatter:function(name){
                var oa = option.series[0].data;
                var num = oa[0].value + oa[1].value + oa[2].value + oa[3].value+oa[4].value+oa[5].value;
                for(var i = 0; i < option.series[0].data.length; i++){
                    if(name==oa[i].name){
                        return name +  ' '+oa[i].value;
                    }
                }
            },
            data: ['天津','北京','廊坊','上海','杭州','重庆','大连','哈尔滨']
        },
        series : [
            {
                name: 'FK',
                type: 'pie',
                radius : '45%',
                color:['#27c2c1','#9ccb63','#fcd85a','#60c1de','#0084c8','#d8514b','#519cff','#c39705'],
                center: ['38%', '50%'],
                data:[
                    {value:7000, name:'天津'},
                    {value:300, name:'北京'},
                    {value:3000, name:'廊坊'},
                    {value:700, name:'上海'},
                    {value:600, name:'杭州'},
                    {value:1800, name:'重庆'},
                    {value:1500, name:'大连'},
                    {value:1200, name:'哈尔滨'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                },
                itemStyle: {
                    normal: {
                        label:{
                            show: true,
                            position:'outside',
                            formatter: '{b}'
                        }
                    },
                    labelLine :{show:true}
                }
            }
        ]
    };
    professionrate.setOption(option);
 
    /* 比例变化*/
    var changedetail = echarts.init(document.getElementById('changedetail'));
    option = {
        tooltip: {
            trigger: 'axis',
            formatter: '{b}</br>{a}: {c}</br>{a1}: {c1}'
        },
        toolbox: {
            show:false,
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data:['',''],
            show:false
        },
        grid:{
            top:'18%',
            right:'5%',
            bottom:'8%',
            left:'5%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['第一季度','第二季度','第三季度','第四季度'],
                splitLine:{
                    show:false,
                    lineStyle:{
                        color: '#3c4452'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    lineStyle:{
                        color: '#519cff'
                    },
                    alignWithLabel: true,
                    interval:0
                }
            }
        ],
        yAxis: [
            {
                min: 5000,
                max: 8500,
                interval: 500,
                type: 'value',
                name: '数量',
                nameTextStyle:{
                    color:'#fff'
                },
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#23303f'
                    }
                },
                axisLine: {
                    show:false,
                    lineStyle: {
                        color: '#115372'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    alignWithLabel: true,
                    interval:0

                }
            }
        ],
        color:"yellow",
        series: [
            {
                name:'test1',
                type:'bar',
                data:[6000, 7000, 6000, 8200],
                boundaryGap: '45%',
                barWidth:'40%',

                itemStyle: {
                    normal: {
                        color: function(params) {
                            var colorList = [
                                '#7fec9d','#fedd8b','#ffa597','#84e4dd'
                            ];
                            return colorList[params.dataIndex]
                        },label: {
                            show: true,
                            position: 'top',
                            formatter: '{c}'
                        }
                    }
                }
            },

            {
                name:'',
                type:'line',
                yAxisIndex: 0,
                lineStyle: {
                    normal: {
                        color:'#c39705'
                    }
                },
                data:[6000, 7000, 6000, 8200],
            }
        ]
    };
    changedetail.setOption(option);

    /* ===*/
    var juniorservice = echarts.init(document.getElementById('juniorservice'));
    option = {
        tooltip: {
            trigger: 'axis',
            formatter: '{b}</br>{a}: {c}</br>{a1}: {c1}</br>{a2}: {c2}</br>{a3}: {c3}'
        },
        toolbox: {
            show:false,
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data:['天津','北京','廊坊','上海'],
            right:"15%",
            textStyle:{
                color:'#fff'
            }
        },
        grid:{
            top:'18%',
            right:'5%',
            bottom:'8%',
            left:'5%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['第一季度','第二季度','第三季度','第四季度'],
                splitLine:{
                    show:false,
                    lineStyle:{
                        color: '#3c4452'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    lineStyle:{
                        color: '#519cff'
                    },
                    alignWithLabel: true,
                    interval:0,
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                nameTextStyle:{
                    color:'#fff'
                },
                interval: 1000,
                max:8200,
                min: 800,
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#23303f'
                    }
                },
                axisLine: {
                    show:false,
                    lineStyle: {
                        color: '#115372'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    alignWithLabel: true,
                    interval:0

                }
            },
        ],
        color:"yellow",
        series: [
            {
                name:'天津',
                type:'bar',
                data:[6000, 7000, 6000, 8200],
                itemStyle: {
                    normal: {
                        color: '#76da91'
                    },label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
            {
                name:'北京',
                type:'bar',
                data:[200, 300, 800, 900],
                itemStyle: {
                    normal: {
                        color: '#f8cb7f'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
            {
                name:'廊坊',
                type:'bar',
                data:[2300, 3000, 3000, 2500],
                itemStyle: {
                    normal: {
                        color: '#f89588'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'

                    }
                }
            },
            {
                name:'上海',
                type:'bar',
                data:[700, 700, 700, 800],
                itemStyle: {
                    normal: {
                        color: '#7cd6cf'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
        ]
    };
    juniorservice.setOption(option);


    /* ===*/
    var edubalance = echarts.init(document.getElementById('edubalance'));
    option = {
        tooltip: {
            trigger: 'axis',
            formatter: '{b}</br>{a}: {c}</br>{a1}: {c1}</br>{a2}: {c2}</br>{a3}: {c3}'
        },
        toolbox: {
            show:false,
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data:['杭州','重庆','大连','哈尔滨'],
            right:"15%",
            textStyle:{
                color:'#fff'
            }
        },
        grid:{
            top:'18%',
            right:'5%',
            bottom:'8%',
            left:'5%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['第一季度','第二季度','第三季度','第四季度'],
                splitLine:{
                    show:false,
                    lineStyle:{
                        color: '#3c4452'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    lineStyle:{
                        color: '#519cff'
                    },
                    alignWithLabel: true,
                    interval:0,
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                nameTextStyle:{
                    color:'#fff'
                },
                interval: 100,
                max:1500,
                min: 100,
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#23303f'
                    }
                },
                axisLine: {
                    show:false,
                    lineStyle: {
                        color: '#115372'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel:{
                    textStyle:{
                        color:"#fff"
                    },
                    alignWithLabel: true,
                    interval:0

                }
            },
        ],
        color:"yellow",
        series: [
            {
                name:'杭州',
                type:'bar',
                data:[600, 600, 700, 700],
                itemStyle: {
                    normal: {
                        color: '#9ccb63'
                    },label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
            {
                name:'重庆',
                type:'bar',
                data:[200, 300, 800, 900],
                itemStyle: {
                    normal: {
                        color: '#fcd85a'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
            {
                name:'大连',
                type:'bar',
                data:[1000, 1500, 1500, 1200],
                itemStyle: {
                    normal: {
                        color: '#60c1de'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'

                    }
                }
            },
            {
                name:'哈尔滨',
                type:'bar',
                data:[800, 1200, 1200, 1000],
                itemStyle: {
                    normal: {
                        color: '#0084c8'},
                    label: {
                        show: true,
                        position: 'top',
                        formatter: '{c}'
                    }
                }
            },
        ]
    };
    edubalance.setOption(option);

    /* 地图 需要哪个省市的地图直接引用js 将下面的name以及mapType修改为对应省市名称*/
    var maps = echarts.init(document.getElementById('mapadd'));
    option = {
        tooltip : {
            trigger: 'item',
            formatter: '{b}'
        },
        series: [
            {
                name: '数据',
                type: 'map',
                mapType: 'china',
                roam: false,
                zoom:1.25,
                itemStyle:{
                    normal:{
                        label:{
                            show:true,
                            textStyle: {
                                color: "#2c2d2f"
                            }
                        },
                        areaStyle:{color:'#90c1ee'},
                        color:'#6ba8e0',
                        borderColor:'#6ba8e0'//区块的边框颜色
                    },
                    emphasis:{//鼠标hover样式
                        label:{
                            show:true,
                            textStyle:{
                                color:'#04fa3d'
                            }
                        },
                        areaStyle:{
                            color:'#47a0f1'
                        }
                    }
                },
              
                data: [
                    
            {name:'江苏',
                value:1,
            },
            {name:'安徽',value:1,},
            {name:'湖北',value:1},
            {name:'湖南',value:1},
            {name:'广东',value:1},
            {name:'浙江',value:1,
                itemStyle: {
                    normal: {
                        areaColor: '#13d5ff',
                        borderColor: '#45b5ef',
                    }
                }},
            {name:'福建',value:45146},
            {name:'山东',value:42753},
            {name:'河南',value:31141},
            {name:'四川',value:30287},
            {name:'河北',value:29890,
            itemStyle: {
                normal: {
                    areaColor: '#13d5ff',
                    borderColor: '#45b5ef',
                }
            }},
            {name:'江西',value:23649},
            {name:'黑龙江',value:20475,
                itemStyle: {
                    normal: {
                        areaColor: '#13d5ff',
                        borderColor: '#45b5ef',
                    }
                }},
            {name:'陕西',value:17942},
            {name:'贵州',value:16019},
            {name:'吉林',value:15441},
            {name:'广西',value:11875},
            {name:'山西',value:11077},
            {name:'云南',value:9238},
            {name:'辽宁',value:6538},
            {name:'甘肃',value:6128},
            {name:'重庆',value:5883},
            {name:'内蒙古',value:5605},
            {name:'海南',value:4596},
            {name:'天津',value:4244,
                itemStyle: {
                    normal: {
                        areaColor: '#13d5ff',
                        borderColor: '#45b5ef',
                    }
                }},
            {name:'新疆',value:4125},
            {name:'上海',value:3429,
                itemStyle: {
                    normal: {
                        areaColor: '#13d5ff',
                        borderColor: '#45b5ef',
                    }
                }
            },
            {name:'宁夏',value:3225},
            {name:'青海',value:1833},
            {name:'北京',value:1765,
                itemStyle: {
                    normal: {
                        areaColor: '#13d5ff',
                        borderColor: '#45b5ef',
                    }
                }},
                ]
                
            }
        ]
       
    };
    maps.setOption(option);

})